<template>
    <div class="homeswiper">
        <van-search v-model="searchValue" placeholder="请输入搜索关键词" />
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="item in bannerData" :key="item.id"> 
      <img src="item.picUrl" alt="">
    </van-swipe-item>
      <!-- <van-swipe-item>1</van-swipe-item>
      <van-swipe-item>2</van-swipe-item>
      <van-swipe-item>3</van-swipe-item>
      <van-swipe-item>4</van-swipe-item> -->
</van-swipe>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    data() {
    return {
      searchValue: '',
      bannerData:[]
    };
  },
  created(){
    this.getBanner()
  },
  methods:{
    getBanner(){
      axios.get("http://171.220.242.237:3002/recommend/banner")
      .then(res => {
        console.log(res)
      })
      .catch(err => {
        console.error(err); 
      })
    }
  }
}
</script>
<style scoped>
     .my-swipe .van-swipe-item {
    /* color: #fff; */
    width: 90%;
    font-size: 20px;
    /* line-height: 150px; */
    /* text-align: center; */
    /* background-color: #39a9ed; */
  }
</style>